-
Notifications
You must be signed in to change notification settings - Fork 0
refactor: fixture overhaul #68
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Adds the base life cycle (initialize, initalized, exit, shutdown, invalid request) messages into the global conftest. They are built on each fixture appending their messages into a list of notifications, requests, or responses (and a total messages) list. The added utils include a way to build these into a BytesIO buffer based on a previous 'build_payload' function. Furthermore, adds a function to add 'find_last_request' to aid with certain related scenarios when building fixtures. Lastly, a new constant 'CONTENT_HEADER_TYPE' with the standard added header of the python-lsp-jsonrpc library.
Previously used uritools. For consistency, at least for now, its being switched to Path.as_uri.
breaking: Added skip to test_diagnostics_when_changing_file_with_error because the server is strangely not sending any diagnostic notifications.
…xt_document_notification.py
…text_document_notification.py
Closed
Collaborator
|
I think everything is perfect, very organized and simple to understand. Great job! (my previous comment was related to something I had misunderstood, please ignore it!) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR overhauls most tests. Some tests were simply parametrized but a of LSP tests lot were modified into using a new fixture system. The new system builds each message as a fixture, or possibly modifying one, and are built into a stream at the end using e.g.
build_rpc_stream. Almost all of these fixtures will be found intests/fixtures/lsp/, with the most common found in the respectiveconftest.py.These changes provide an overall more readable and maintainable test suite.
On a bonus note, it has also reduced the time it takes to run the tests.
Closes #52